<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<%@ page import="java.sql.*,java.util.Scanner"%>
<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>外显子查询</title>
</head>
<body>
<%
    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;
    Scanner sc;

    String url="jdbc:mysql://localhost/gene?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT&useSSL=false";
    String user="root";
    String pwd="gyl20030217";

    Class.forName("com.mysql.cj.jdbc.Driver");
    conn=DriverManager.getConnection(url,user,pwd);
    stmt = conn.createStatement();
    String sql = "select transcript_id,exon_id,start,end,ranks "
            + "from exon55 join exon_transcript55 using (exon_id) "
            + "where transcript_id =11145020";
    rs = stmt.executeQuery(sql);
%>
<p>
transcript_id为11145020的转录本所对应的外显子为
</p>
<%--transcript_id\t" + "start\t" + "end\t" + "ranks--%>
<table>
    <tr>
        <td>transcript_id</td>
        <td>start</td>
        <td>end</td>
        <td>ranks</td>
    </tr>
<%
    String id,start,end,ranks;
    while (rs.next()){
        id = rs.getString("transcript_id");
        start  =rs.getString("start");
        end = rs.getString("end");
        ranks = rs.getString("ranks");
       %>
    <tr>
    <td><%=id%></td>
    <td><%=start%></td>
    <td><%=end%></td>
    <td><%=ranks%></td>
</tr>

<%
//        System.out.println(id + "\t" + start + "\t" + end + "\t" + ranks);
    }
    %>
</table>
    <%
    if(rs!=null){
        rs.close();
    }
    if(stmt!=null){
        stmt.close();
    }
    if(conn!=null){
        conn.close();
    }
%>

</body>
</html>